import { Controller, Inject, Post, Body } from '@midwayjs/core';
import { UserService } from '../service/user.service';

@Controller('/data')
export class TempController {
  @Inject()
  userService: UserService;

  @Post('/save')
  async saveTempData(@Body() data: { time: string; temp: number; humi: number }) {
    return await this.userService.saveUser(data);
  }
}
